package com.film;

/**
 * @author HustleLr
 * @version 1.0.0
 * @date 2023/12/13 11:23
 * @describe ReservationSystem
 */
public class ReservationSystem {
    public static void main(String[] args) {
        // 假设这里是用户填写表单并提交的过程
        MovieReservationForm form = new MovieReservationForm();
        form.setCustomerName("张三");
        form.setContactNumber("123456789");
        form.setMovieTime("2023-12-25 19:30");

        if (form.isValid()) {
            System.out.println("预订成功！");
            System.out.println(form);
            // 模拟保存到数据库
            saveToDatabase(form);
        } else {
            System.out.println("预订失败：表单验证未通过！");
        }
    }

    private static void saveToDatabase(MovieReservationForm form) {
        // 模拟数据库保存操作
        System.out.println("正在保存到数据库...");
    }
}
